package com.ldci.bean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONException;
import org.json.JSONObject;

public class BaseBean {
	public String makeInsertJSON(boolean flag) throws Exception{
		JSONObject son = new JSONObject();
		ArrayList list = new ArrayList();
		if(flag){
			Map<String,Object> map = new HashMap<String,Object>();
			map.put("state", 1);
			map.put("hbCode", 10);	
			list.add(map);
			son.put("result", list);

		}else{
			Map<String,Object> map = new HashMap<String,Object>();
			map.put("state", 20);
			map.put("hbCode", 0);	
			list.add(map);
			son.put("result", list);
		}
		return son.toString();
	}
	
	public String makeDeleteJSON(){
		String state = "2";
		String hbCode = "9";
		String str = "{'state':'"+state+"','reset':'false','formId':'editDataForm','hbCode':'"+hbCode+"'}";
		return str;
	}

}
